////////////////////////////////////////////////////////////////////////////////
// Filename: graphics.hpp
////////////////////////////////////////////////////////////////////////////////
#ifndef GRAPHICS_HPP_
#define GRAPHICS_HPP_

#define Matrix D3DXMATRIX

//////////////
// INCLUDES //
//////////////
#include "direct3d.hpp"
#include "../graphics/shaders/positioncolorshader.hpp"
#include "../graphics/shaders/positiontextureshader.hpp"
#include "../system/camera.hpp"
#include "irenderble.hpp"
#include <windows.h>
#include <queue>

////////////////////////////////////////////////////////////////////////////////
// Class name: Graphics
////////////////////////////////////////////////////////////////////////////////
class Graphics {
public:
	Graphics();
	~Graphics();

	bool Initialize(int, int, HWND);
	void Shutdown();
	void BeginScene(float, float, float, float);
	void EndScene();

	Camera* GetCamera();
	miv::PositionColorShader* GetShader();
	PositionTextureShader* GetTextureShader();
	Direct3D* GetDirect3D();
	void GetWorldMatrix(D3DXMATRIX&);
	void GetProjectionMatrix(D3DXMATRIX&);

	// Transformation
	void Rotate(Matrix* iM, float x, float y, float z);
	void RotateX(Matrix* iM, float x);
	void RotateY(Matrix* iM, float y);
	void RotateZ(Matrix* iM, float z);
	void Translate(Matrix* iM, float x, float y, float z);
	void TranslateX(Matrix* iM, float x);
	void TranslateY(Matrix* iM, float y);
	void TranslateZ(Matrix* iM, float z);
	void Scale(Matrix* iM, float x, float y, float z);
	void ScaleX(Matrix* iM, float x);
	void ScaleY(Matrix* iM, float y);
	void ScaleZ(Matrix* iM, float z);

private:
	Direct3D* m_direct3D;
	miv::PositionColorShader* shader;
	PositionTextureShader* m_textureShader;
	Camera* camera;
public:
	std::queue<miv::IRenderble*>* m_renderQueue;
};

#endif
